using System.Collections.Generic;

namespace FastMapper.Core
{
    public class PropertyMatchFormatter : IPropertyMatchFormatter
    {
        private readonly HashSet<string> _prefixes = new HashSet<string>();
        private readonly HashSet<string> _postFixes = new HashSet<string>();
        private readonly HashSet<IPropertyMatchCondition> _propertyMatchConditions = new HashSet<IPropertyMatchCondition>(); 

        public IEnumerable<string> Prefixes
        {
            get { return _prefixes; }
        }
        public IEnumerable<string> PostFixes
        {
            get { return _postFixes; }
        }
        public IEnumerable<IPropertyMatchCondition> PropertyMatchConditions
        {
            get { return _propertyMatchConditions; }
        }
        public void AddPrefixe(string prefixe)
        {
            _prefixes.Add(prefixe);
        }

        public void AddPrefixes(IEnumerable<string> prefixes)
        {
            _prefixes.IntersectWith(prefixes);
        }

        public void AddPostFixes(IEnumerable<string> postfixes)
        {
            _prefixes.IntersectWith(postfixes);
        }

        public void AddPostFixe(string postfixe)
        {
            _postFixes.Add(postfixe);
        }

        public void AddCustomPropertyMatchCondition(IPropertyMatchCondition propertyMatchCondition)
        {
            _propertyMatchConditions.Add(propertyMatchCondition);
        }
    }
}